package com.content.scaffold.common.constants;

/**
 * @author xiaojl
 */
public class RedisKey {


    /**
     * 用户登录
     */
    private final static String LOGIN_USER_KEY = "login_user_key:";

    /**
     * 登录有效期 现默认2个小时
     */
    public final static Long LOGIN_USER_EXPIRE_TIME = 60 * 60 * 2L;


    /**
     * 有效期 10分钟
     */

    public final static Long MSG_CODE_EXPIRE_TIME = 60 * 10L;

    /**
     * 验证码重置密码
     */
    public final static String MSG_LOCK_KEY = "MSG_LOCK_KEY:";
    /**
     * 有效期一分钟
     */
    public final static Long MSG_LOCK_EXPIRE_TIME = 60L;


    public final static Long DICT_EXPIRE_TIME = 60 * 60 * 24L;


    public static String getLoginUserKey(String token) {
        return LOGIN_USER_KEY + token;
    }


    public static String getRedisKey(String key, String notaryOfficeId) {
        return String.format(key, notaryOfficeId);
    }

    public static String getRedisKey(String key, String type, String notaryOfficeId) {
        return String.format(key, notaryOfficeId, type);
    }
}
